package com.design.patterns.list.factory.absfactory.pizza.bj;

import com.design.patterns.list.factory.absfactory.pizza.Pizza;
import com.design.patterns.list.factory.absfactory.pizza.PizzaFactory;

/**
 * @author Wangzhiwen
 */
public class BJPizzaFactory extends PizzaFactory {

    public Pizza createPizza(String pizzaName) {
        if ("APizza".equals(pizzaName)) return new APizza();

        if ("BPizza".equals(pizzaName)) return new BPizza();

        throw new RuntimeException("不存在的pizza");
    }

}
